"""
Database class
"""
from db.excel_handler import excel_save


class Database:
    def __init__(self,ip_list,**kwargs):
        self.instance_name = kwargs.get("instance_name")
        self.instance_rename = kwargs.get("instance_rename")
        self.db_name = kwargs.get("db_name")
        self.os_release = kwargs.get("db_name")
        self.ip_list = ip_list
        self.port = kwargs.get("port")
        self.connect_status = None
        self.sync_status = None
        self.account_status = None
        self.is_bad = None
        self.is_manual_sync = False

    def save(self, rowx):
        excel_save(self, rowx)

    def __str__(self):
        return "%s %s %s %s %s %s %s %s\n" % (
            self.instance_name, self.instance_rename, self.db_name, self.ip, self.os_release, self.connect_status,
            self.sync_status,
            self.account_status)

    def __repr__(self):
        return "%s %s %s %s %s %s %s %s\n" % (
            self.instance_name, self.instance_rename, self.db_name, self.ip, self.os_release, self.connect_status,
            self.sync_status,
            self.account_status)
